<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="no"/>
    <meta name="wap-font-scale" content="no">
    <meta content="telephone=no" name="format-detection">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>滚滚筹-我的认筹项目</title>
    <link rel="stylesheet" href="css/swiper.min.css">
    <link rel="stylesheet" href="css/common.min.css">
    <link rel="stylesheet" href="css/base.min.css">
    <link rel="stylesheet" href="css/user.min.css">
</head>
<body class="isHide">
<div class="wrap height top">
    <div class="header border">
        <div class="left">
            <a href="javascript:;">
                <i class="sprite icon-back"></i>
            </a>
        </div>
        <div class="mid">
            <label class="text"><span>我的认筹项目</span></label>
        </div>
    </div>
    <div class="wrap height background g-f5">
        <div class="fb-tab-bar wrap height top">
            <div class="fb-tab-menu white big no-mar abs-tl">
                <div class="swiper-container" id="inNav">
                    <div class="swiper-wrapper">
                        <div class="swiper-slide active" data-id="ALL">全部</div>
                        <div class="swiper-slide " data-id="ZCZ">众筹中</div>
                        <div class="swiper-slide " data-id="CSZ">出售中</div>
                        <div class="swiper-slide " data-id="TPZ">投票中</div>
                        <div class="swiper-slide " data-id="DHK">待回款</div>
                        <div class="swiper-slide " data-id="YWC">已完成</div>
                    </div>
                </div>
            </div>
            <div class="fb-wrap-height">
                <div class="wrap height overflow-hide background g-f5">
                    <div class="swiper-container overflow-hide product-swiper" id="productSwiper">
                        <div class="swiper-wrapper">
                            <div class="swiper-slide" id="ALL">
                                <div class="fb-wrap-height overflow" id="ALLFlow">
                                    <div class="overflow-box">
                                        <div class="product-information evaluate-bar mt-10">
                                            <div class="evaluate-list">
                                                <div class="list">
                                                    <ul>
                                                        <li>
                                                            <label class="d-block mb-10 clearfix">
                                                                <span class="tc-ff3d3d fs-14 tm-bold ">众筹中</span>
                                                                <em class="tc-999 fs-12 fr">认筹时间：2017-08-01 23:00</em>
                                                            </label>
                                                            <div class="product none border-none-top pt-0 mt-0 clearfix">
                                                                <div class="fb-list">
                                                                    <div class="item">
                                                                        <a href="details.html">
                                                                            <label class="pro-img"><img
                                                                                    src="img/product.jpg"></label>
                                                                            <div class="pro-intro">
                                                                                <label class="pro-name tm-clamp tc-333 fs-14">
                                                                                    <em class="tc-user">第十期</em>
                                                                                    凯迪拉克ATS-L2017款技术型项目
                                                                                </label>
                                                                                <span class="pro-time tm-ellipsis tc-999 fs-12">众筹金额：¥ 32,500,00</span>
                                                                                <span class="pro-time tm-ellipsis tc-999 fs-12">众筹金额：¥ 1,218,800</span>
                                                                            </div>
                                                                        </a>
                                                                    </div>
                                                                </div>
                                                                <div class="crowd-btn mt-15 clearfix">
                                                                    <a class="fb-btn line-block background blue-bigger no-bd fb-radius-3 fs-15 fl"
                                                                       href="javascript:;">投票</a>
                                                                    <a class="fb-btn line-block line blue-light fs-15 fr"
                                                                       href="crowd-details.html">查看详情</a>
                                                                </div>
                                                            </div>
                                                        </li>
                                                        <li>
                                                            <label class="d-block mb-10 clearfix">
                                                                <span class="tc-ff3d3d fs-14 tm-bold ">众筹中</span>
                                                                <em class="tc-999 fs-12 fr">认筹时间：2017-08-01 23:00</em>
                                                            </label>
                                                            <div class="product none border-none-top pt-0 mt-0 clearfix">
                                                                <div class="fb-list">
                                                                    <div class="item">
                                                                        <a href="details.html">
                                                                            <label class="pro-img"><img
                                                                                    src="img/product.jpg"></label>
                                                                            <div class="pro-intro">
                                                                                <label class="pro-name tm-clamp tc-333 fs-14">
                                                                                    <em class="tc-user">第十期</em>
                                                                                    凯迪拉克ATS-L2017款技术型项目
                                                                                </label>
                                                                                <span class="pro-time tm-ellipsis tc-999 fs-12">众筹金额：¥ 32,500,00</span>
                                                                                <span class="pro-time tm-ellipsis tc-999 fs-12">众筹金额：¥ 1,218,800</span>
                                                                            </div>
                                                                        </a>
                                                                    </div>
                                                                </div>
                                                                <div class="crowd-btn mt-15 clearfix">
                                                                    <a class="fb-btn line-block background blue-bigger no-bd fb-radius-3 fs-15 fl"
                                                                       href="javascript:;">投票</a>
                                                                    <a class="fb-btn line-block line blue-light fs-15 fr"
                                                                       href="crowd-details.html">查看详情</a>
                                                                </div>
                                                            </div>
                                                        </li>
                                                        <li>
                                                            <label class="d-block mb-10 clearfix">
                                                                <span class="tc-ff3d3d fs-14 tm-bold ">众筹中</span>
                                                                <em class="tc-999 fs-12 fr">认筹时间：2017-08-01 23:00</em>
                                                            </label>
                                                            <div class="product none border-none-top pt-0 mt-0 clearfix">
                                                                <div class="fb-list">
                                                                    <div class="item">
                                                                        <a href="details.html">
                                                                            <label class="pro-img"><img
                                                                                    src="img/product.jpg"></label>
                                                                            <div class="pro-intro">
                                                                                <label class="pro-name tm-clamp tc-333 fs-14">
                                                                                    <em class="tc-user">第十期</em>
                                                                                    凯迪拉克ATS-L2017款技术型项目
                                                                                </label>
                                                                                <span class="pro-time tm-ellipsis tc-999 fs-12">众筹金额：¥ 32,500,00</span>
                                                                                <span class="pro-time tm-ellipsis tc-999 fs-12">众筹金额：¥ 1,218,800</span>
                                                                            </div>
                                                                        </a>
                                                                    </div>
                                                                </div>
                                                                <div class="crowd-btn mt-15 clearfix">
                                                                    <a class="fb-btn line-block background blue-bigger no-bd fb-radius-3 fs-15 fl"
                                                                       href="javascript:;">投票</a>
                                                                    <a class="fb-btn line-block line blue-light fs-15 fr"
                                                                       href="crowd-details.html">查看详情</a>
                                                                </div>
                                                            </div>
                                                        </li>
                                                    </ul>
                                                </div>
                                                <div class="list-loading g-f5">
                                                    <i><img src="img/loading.gif"></i>
                                                    <span>加载中...</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--置顶按钮-->
<a class="p-fix go-top" href="javascript:;" id="goTop"><img src="img/icon-top.png"></a>

<script type="text/template" id="productListCont">
    <li>
        <label class="d-block mb-10 clearfix">
            <span class="tc-ff3d3d fs-14 tm-bold ">加载数据：众筹中</span>
            <em class="tc-999 fs-12 fr">认筹时间：2017-08-01 23:00</em>
        </label>
        <div class="product none border-none-top pt-0 mt-0 clearfix">
            <div class="fb-list">
                <div class="item">
                    <a href="details.html">
                        <label class="pro-img"><img
                                src="img/product.jpg"></label>
                        <div class="pro-intro">
                            <label class="pro-name tm-clamp tc-333 fs-14">
                                <em class="tc-user">第十期</em>
                                凯迪拉克ATS-L2017款技术型项目
                            </label>
                            <span class="pro-time tm-ellipsis tc-999 fs-12">众筹金额：¥ 32,500,00</span>
                            <span class="pro-time tm-ellipsis tc-999 fs-12">众筹金额：¥ 1,218,800</span>
                        </div>
                    </a>
                </div>
            </div>
            <div class="crowd-btn mt-15 clearfix">
                <a class="fb-btn line-block background blue-bigger no-bd fb-radius-3 fs-15 fl"
                   href="javascript:;">投票</a>
                <a class="fb-btn line-block line blue-light fs-15 fr"
                   href="crowd-details.html">查看详情</a>
            </div>
        </div>
    </li>
</script>
<script type="text/template" id="vote">
    <div class="vote-cont">
        <p>1、投票结果才去少数服从多数的原则，赞成（或 不赞成）投票人数超过众筹总人数的50%即视为 当此投票通过。 </p>
        <p>2、投票结果才去少数服从多数的原则，赞成（或 不赞成）投票人数超过众筹总人数的50%即视为 当此投票通过。 </p>
        <p>3、投票结果才去少数服从多数的原则，赞成（或 不赞成）投票人数超过众筹总人数的50%即视为 </p>
    </div>
    <div class="vote-intro">
        <div class="form-list small">
            <div class="item-text">
                <span class="t">众筹金额：</span>
                <span class="c tc-ff3d3d">￥56233.65</span>
            </div>
            <div class="item-text">
                <span class="t">回款金额：</span>
                <span class="c tc-ff3d3d">￥11233.65</span>
            </div>
            <div class="item-text">
                <span class="t">收益率：</span>
                <span class="c tc-ff3d3d">11.11%</span>
            </div>
        </div>
    </div>
</script>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/swiper.jquery.min.js"></script>
<script src="js/box.js"></script>
<script src="js/common.js"></script>
<script src="js/base.js"></script>
<script>
    $(function () {
        //横向菜单
        var nav = slideHorizontalNav("#inNav", {
            hasPlaceholder: false,
            clickFun: function (index) {
                product.slideTo(index)
            }
        });
        //初始化产品列表左右滑动
        var scrollEle;
        var _clear_timer_ = 0;
        var product = FB.newSwiper("#productSwiper", 1, {
            autoplay: 0,
            pagination: null,
            loop: false,
            autoplayDisableOnInteraction: false,
            lazyLoading: false,
            onInit: function (s) {
                var str = "";
                for (var i = 0; i < nav.length - 1; i++) {
                    str += "<div class='swiper-slide' id='" + nav.navID[i + 1] + "'>" +
                        "<div class='swiper-loading'></div>" +
                        "<div class='fb-wrap-height overflow' id='" + nav.navID[i + 1] + "Flow'>" +
                        "   <div class='overflow-box'>" +
                        "       <div class='product-information evaluate-bar mt-10'>" +
                        "           <div class='evaluate-list'>" +
                        "               <div class='list'>" +
                        "                   <ul></ul>" +
                        "               </div>" +
                        "           </div>" +
                        "       </div>" +
                        "   </div>" +
                        "</div>" +
                        "</div>";
                }
                s.appendSlide(str);
                s.update(true, true);
            },
            onSlideChangeEnd: function (s) {
                clearTimeout(_clear_timer_);
                nav.element[s.activeIndex].click();
                var $container = s.container;
                var $active = $container.find(".swiper-slide-active");
                var $loading = $active.find(".swiper-loading");
                var $productList = $active.find(".evaluate-list ul");
                var $top = $("#goTop");
                var $flowActive = $active.find(".overflow");
                var productHtml = $("#productListCont").html();
                var resultHtml = "";
                if (!$active.find(".overflow").data("scroll")) {
                    console.log("执行");
                    scrollEle = scrollFun($active.find(".overflow").attr("id"));
                    console.log(scrollEle);
                }
                if ($loading.css("display") == "block") {
                    _clear_timer_ = setTimeout(function () {
                        $loading.hide();
                        for (var i = 0; i < 3; i++) {
                            resultHtml += productHtml;
                        }
                        $productList.append(resultHtml);
                        $productList.after("<div class='list-loading g-f5'><i><img src='img/loading.gif'></i><span>加载中...</span></div>");
                        ($flowActive.scrollTop() < 90) ? $top.hide() : $top.show();
                    }, 1000);
                } else {
                    ($flowActive.scrollTop() < 90) ? $top.hide() : $top.show();
                }
            }
        });
        //页面滚动
        function scrollFun(ele) {
            var ajaxDataNum = 0, downflag = false;
            return pageScroll({
                hasTop: true,
                element: "#" + ele,
                ajaxFun: function () {
                    var $active = $("#productSwiper .swiper-slide-active");
                    if (!downflag) {
                        downflag = true;
                        var list = $("#productListCont").html();
                        var str = "";
                        for (var i = 0; i < 2; i++) {
                            str += list;
                        }
                        setTimeout(function () {
                            ajaxDataNum++;
                            if (ajaxDataNum >= 5) {
                                $active.find(".list-loading").html("没有更多数据了!");
                                return false;
                            }
                            $active.find(".evaluate-list ul").append(str);
                            downflag = false;
                        }, 1000);
                    }
                }
            });
        }
        scrollEle = scrollFun("ALLFlow");
        //获取URL参数
        var navType = FB.getQueryString("id");
        if (!!navType) $("#inNav").find(".swiper-slide[data-id='" + navType + "']").click();
        //投票
        $(document).on("click touchend", ".crowd-btn a:eq(0)", function () {
            $.jConfirm({
                title: "我要投票",
                intro: $("#vote").html(),
                close: true
            }, [
                {
                    text: "<em class='tc-user'>31.11%</em><span class=''>赞成</span>",
                    cls: "border-none-right",
                    callback: function () {
                        $.jAlert.tips("你点击了赞成");
                    }
                },
                {
                    text: "<em class='tc-ff3d3d'>34.33%</em><span class=''>反对</span>",
                    callback: function () {
                        $.jAlert.tips("你点击了反对");
                    }
                }
            ], "H", null, {
                width: "250px",
                cls: {
                    boxCls: "coupon-box",
                    titleCls: "coupon-title tc-333",
                    tipsBarCls: "pad-all-0",
                    btnCls: "vote-btn border-none-top"
                }
            });
        });
    })
</script>
</body>
</html>